<template>
  <div class="beak-rule-list">
    <ul class="jsd-card-list">
      <li is="card" v-for="item of illegalData">
        <div class="jsd-card-title" slot="card-title">
          <time>{{item.time}}</time>
          <span>驾照扣分：<strong>{{item.degree}}</strong></span>
        </div>
        <ul class="jsd-card-body" slot="card-content">
          <li><strong>罚款：</strong><span>{{item.totalMoney}}元</span></li>
          <li>
            <strong>违章地点：</strong>
            <span>{{item.address}}</span>
          </li>
          <li>
            <strong>违章内容：</strong>
            <span>{{item.reason}}</span>
          </li>
        </ul>
      </li>
      <!--正在加载提示框-->
      <div is="loading" v-if="loadShow"></div>
      <!--加载失败弹框-->
      <div is="dialog-box" :message="dialogMessage" v-if="dialogShow" @close-dialog='closeDialog'></div>
      <li class="no_data" v-if="!illegalData.length">
        <i class="ion ion-ios-paper-outline"></i>
        <p>暂无数据</p>
      </li>
    </ul>
  </div>
</template>
<script>
  import card from '../../widget/card.vue'
  // import '../../assets/css/break_rules_records.scss';
  import getInterface from '../../assets/js/insterface'
  import http from '../../assets/js/http_mixin'
  let illegalByWeekUrl = getInterface.getIllegalByWeekUrl;
  export default{
    data(){
      return {
        illegalData: []
      }
    },
    mixins: [http],
    components:{
      card
    },
    mounted()
    {
      document.title = '违章记录';
      // 请求页面信息
      this.getInfo({
        url: illegalByWeekUrl,
        param: {
          'empNo': this.$route.query.empNo
        },
        success: function (response) {
          console.log(response);
          if(response.data.resType == "00"){
            this.illegalData = response.data.data;
          }else{
            console.log(response.data.msg);
          }
        },
        fail: function (response) {
          this.dialogMessage = '请求失败，请稍后再试';
          this.dialogShow = true;
        }
      })
    }

  }
</script>